package com.xcc.app2;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Toast;

import com.bigkoo.pickerview.OptionsPickerView;

import java.util.ArrayList;
import java.util.List;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        findViewById(R.id.button).setOnClickListener(new View.OnClickListener() {
            public void onClick(View v) {
                startService(new Intent(MainActivity.this, TestService.class));
            }
        });
        // 这段用于删除测试--------------->>
        final List<String> list = new ArrayList<>();
        findViewById(R.id.button2).setOnClickListener(new View.OnClickListener() {
            public void onClick(View v) {
                OptionsPickerView pickerView = new OptionsPickerView
                        .Builder(MainActivity.this, new OptionsPickerView.OnOptionsSelectListener() {
                    public void onOptionsSelect(int options1, int options2, int options3, View v) {
                        String s = list.get(options1);
                        Toast.makeText(MainActivity.this, s, Toast.LENGTH_SHORT).show();
                    }
                }).build();
                pickerView.setPicker(list);
                pickerView.show();
            }
        });
        list.add("xcc");
        list.add("rookieCi");
        list.add("帅");
        // 这段用于删除测试---------------<<
    }


}
